function [com, vol, objf, mphi] = forcing(V,T,u,phi,e,nu)
% function [com, vol, objf, mphi] = forcing(V,T,u,phi,e,nu)
% calculate the foring term and the compliance and the object value for phase  

[ com,dcom] = compliance(V,T,u,phiC,e,nu);
[ vol,dvol] = volume(V,T,phi);

% some computational parameter to balance the effection for different terms
lag = 80;     % Lagrange multiplier for volume constraint
coef = 10.0; %Coefficient of sensitivity, 10 or 20 works well.
wcoef = 0.25; %Coefficient of double well potential, it should not be changed from the typical value.

objf = sum(com) + lag*sum(vol);%Calcurate objective function
dobjf = dcom + lag*dvol;%Calcurate sensitivity

G1 = coef*dobjf/norm(dobjf);%Coefficient of function g(phi). It is conposed of normalized sensitivity and coefficient. 

%Calcurate a part of reaction term, which is used in the semi-implicit
%method.
mphi = -((1 - 2 * phi) .* 2 * wcoef + 30 * phi .* (1 - phi) .* G); 

